package main

import (
	"go.uber.org/zap"
)

func main()  {

	logger, _ := zap.NewProduction() //生产环境的用法
	//logger, _ := zap.NewDevelopment() //开发环境

	defer logger.Sync() // flushes buffer, if any
	url := "http://kankan.meitu.com/"
	//sugar := logger.Sugar()
	// 输出的时候
	//sugar.Infow("failed to fetch URL",
	//	// Structured context as loosely typed key-value pairs.
	//	"url", url,
	//	"attempt", 3,
	//	"backoff", time.Second,
	//)
	//sugar.Infof("Failed to fetch URL: %s", url)
	//sugar.Errorf("Failed to fetch URL: %s", url)

	logger.Info("Failed to fetch URL: %s",
		zap.String("url", url),
		zap.Int("number", 1),
	)

}
